package br.com.felix.fwt.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Util {
	
	private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

	public static boolean isNullOrEmpty(String value) {
		return value == null || "".equals(value);
	}

	
	public static boolean isAValidEmail(String value){
		return value !=null && value.matches("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$");
	}
	
	public static Date parseYMD(String dataYMD) throws ParseException{
		return sdf.parse(dataYMD);
	}
	
}
